home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / kerberos / pc / krb_libd.lha / Lib / Des / DESGLUE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-18  |  2.4 KB  |  110 lines

  1. /*
  2.  *    $Source: /mit/kerberos/src/lib/des/RCS/desglue.c,v $
  3.  *    $Author: jtkohl $
  4.  *    $Header: desglue.c,v 4.1 88/11/15 11:41:18 jtkohl Exp $
  5.  *
  6.  *    Copyright (C) 1988 by the Massachusetts Institute of Technology
  7.  *
  8.  * For copying and distribution information, please see the file
  9.  * <mit-copyright.h>.
  10.  *
  11.  * Backwards compatibility module.
  12.  */
  13.  
  14. #ifndef lint
  15. static char *rcsid_desglue_c = "$Header: desglue.c,v 4.1 88/11/15 11:41:18 jtkohl Exp $";
  16. #endif /* lint */
  17.  
  18. #ifndef NCOMPAT
  19. #include <des.h>
  20.  
  21. #undef string_to_key
  22. #undef read_pw_string
  23. #undef random_key
  24. #undef pcbc_encrypt
  25. #undef key_sched
  26. #undef cbc_encrypt
  27. #undef cbc_cksum
  28. #undef C_Block_print
  29. #undef quad_cksum
  30.  
  31. int
  32. string_to_key(str, key)
  33.     char *str;
  34.     register des_cblock *key;
  35. {
  36.     return des_string_to_key(str, key);
  37. }
  38.  
  39.  
  40. int
  41. read_pw_string(s, max, prompt, verify)
  42.     char *s;
  43.     int max;
  44.     char *prompt;
  45.     int verify;
  46. {
  47.     return des_read_pw_string (s, max, prompt, verify);
  48. }
  49.  
  50. random_key(key)
  51.     des_cblock *key;
  52. {
  53.     return des_random_key(key);
  54. }
  55.  
  56. pcbc_encrypt(in, out, length, key, iv, encrypt)
  57.     des_cblock *in, *out;
  58.     register long length;
  59.     des_key_schedule key;
  60.     des_cblock *iv;
  61.     int encrypt;
  62. {
  63.     return des_pcbc_encrypt (in, out, length, key, iv, encrypt);
  64. }
  65.  
  66. key_sched(k, s)
  67.     unsigned char *k;
  68.     des_key_schedule s;
  69. {    
  70.     return des_key_sched (k, s);
  71. }
  72.  
  73. cbc_encrypt(in, out, length, key, iv, encrypt)
  74.     des_cblock *in, *out;
  75.     register long length;
  76.     des_key_schedule key;
  77.     des_cblock *iv;
  78.     int encrypt;
  79. {
  80.     return des_cbc_encrypt (in, out, length, key, iv, encrypt);
  81. }
  82.  
  83. cbc_cksum(in, out, length, key, iv)
  84.     des_cblock *in;        /* >= length bytes of inputtext */
  85.     des_cblock *out;        /* >= length bytes of outputtext */
  86.     register long length;    /* in bytes */
  87.     des_key_schedule key;        /* precomputed key schedule */
  88.     des_cblock *iv;        /* 8 bytes of ivec */
  89. {
  90.     return des_cbc_cksum(in, out, length, key, iv);
  91. }
  92.  
  93. C_Block_print(x)
  94.     des_cblock *x;
  95. {    
  96.     return des_cblock_print (x);
  97. }
  98.  
  99. unsigned long
  100. quad_cksum(in,out,length,out_count,c_seed)
  101.     des_cblock *c_seed;        /* secret seed, 8 bytes */
  102.     unsigned char *in;        /* input block */
  103.     unsigned long *out;        /* optional longer output */
  104.     int out_count;        /* number of iterations */
  105.     long length;        /* original length in bytes */
  106. {
  107.     return des_quad_cksum(in,out,length,out_count,c_seed);
  108. }
  109. #endif
  110.